package com.aruba.mapper.impl;

import com.aruba.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class UserMapperImpl implements UserMapper {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public int updateMoney(int id, int money) {
        String sql = "update user set money =money + ? where id =?";
        Object[] args = {money, id};
        return jdbcTemplate.update(sql, args);
    }
}
